package com.etc.util;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

/**
 * @Author kalista
 * @Description
 * @Date 2021/5/22  10:15
 **/
public class ConfigUtil {

    static Properties  properties = new Properties();


    static {
        InputStream inputStream = ConfigUtil.class.getClassLoader().getResourceAsStream("config.properties");
        try {
            properties.load(inputStream);
        } catch (IOException e) {
            e.printStackTrace();
        }

    }


    public static String getConfig(String key){
        return (String) properties.get(key);
    }

    public static void main(String[] args) {
        String config = ConfigUtil.getConfig("jedis.pool.port");
        System.out.println(config);
    }


}
